FROM test_env:origin AS builder

USER txtdeal
# 复制部署包到 app目录
# COPY source dest
COPY  ./prdt_doc_to_rec_deploy_*.tar.gz  /app
COPY  ./additional_deps.tar.gz  /app


RUN sudo yum install -y net-tools telnet

RUN cd /app &&\
    # 解压附加依赖包
    if [ -f "additional_deps.tar.gz" ]; then \
    echo "解压附加依赖包: additional_deps.tar.gz"; \
    tar -zxvf additional_deps.tar.gz; \
    else \
    echo "未找到附加依赖包: additional_deps.tar.gz"; \
    exit 1; \
    fi


# 执行部署脚本
RUN cd /app && export CUSTOM_OPENSSL_LIB="/opt/local/installed_deps/openssl/lib" &&\
    tar -zxvf prdt_doc_to_rec_deploy_*.tar.gz &&\
    cd prdt_doc_to_rec_deploy_* &&\
    ./deploy_prod.sh --add "../additional_deps" --run-test --renv t1 &&\
    ./stop.sh








